using ASP;
using HoWave.Web;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.UI;
public class Shop_UserControls_SalerRecommendProduct : UserControl
{
	private int m_salerID;
	private int m_shopID;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public int SalerID
	{
		get
		{
			return this.m_salerID;
		}
		set
		{
			this.m_salerID = value;
		}
	}
	public int ShopID
	{
		get
		{
			return this.m_shopID;
		}
		set
		{
			this.m_shopID = value;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
	}
	protected void ShowSalerRecommendProduct()
	{
		if (this.m_salerID > 0)
		{
			Shop_Product shop_Product = new Shop_Product();
			DataTable recommendProductBySalerID = shop_Product.GetRecommendProductBySalerID(this.m_salerID);
			if (recommendProductBySalerID.Rows.Count > 0)
			{
				int num = recommendProductBySalerID.Rows.Count;
				if (recommendProductBySalerID.Rows.Count > 6)
				{
					num = 6;
				}
				string text = "<ul>";
				for (int i = 0; i < num; i++)
				{
					string text2 = recommendProductBySalerID.Rows[i]["ProductSmallImageUrl"].ToString();
					if (string.IsNullOrEmpty(text2) || text2 == "")
					{
						text2 = "Images/nopicture.gif";
					}
					string text3 = text;
					text = string.Concat(new string[]
					{
						text3,
						"<li><a href='Auction.aspx?ProductID=",
						recommendProductBySalerID.Rows[i]["ProductID"].ToString(),
						"'><img src='../",
						text2,
						"' align='middle' /></a><em>",
						recommendProductBySalerID.Rows[i]["ProductPrice"].ToString(),
						"</em><a href='Auction.aspx?ProductID=",
						recommendProductBySalerID.Rows[i]["ProductID"].ToString(),
						"' title='",
						recommendProductBySalerID.Rows[i]["ProductName"].ToString(),
						"'>"
					});
					if (recommendProductBySalerID.Rows[i]["ProductName"].ToString().Length > 25)
					{
						text = text + recommendProductBySalerID.Rows[i]["ProductName"].ToString().Substring(0, 26) + "</a></li>";
					}
					else
					{
						text = text + recommendProductBySalerID.Rows[i]["ProductName"].ToString() + "</a></li>";
					}
				}
				text += "</ul>";
				base.Response.Write(text);
			}
		}
	}
}
